package com.lxh.weekendmvc.services.impl;

import com.lxh.weekendmvc.dao.DeptDao;
import com.lxh.weekendmvc.entity.Dept;
import com.lxh.weekendmvc.services.DeptServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class DeptServicesImpl implements DeptServices {
    @Autowired
    private DeptDao deptDao;

    @Override
    @Transactional(readOnly = true,propagation = Propagation.SUPPORTS)
    public List<Dept> getAllDept() {
        return deptDao.getAllDept();
    }
}
